package com.own.component.common.condition;

import com.own.constant.ConstantEnvironmentType;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * ConditionTest
 *
 * @author chenxueli
 * @date 2022-08-16 17:01:00
 */
public class ConditionTest implements Condition {

    @Override
    @SuppressWarnings("all")
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        return ConstantEnvironmentType.TEST.equals(context.getEnvironment().getProperty("spring.profiles.active"));
    }

}
